package com.atguigu.gmall.pms.api;

import com.atguigu.gmall.common.bean.PageParamVo;
import com.atguigu.gmall.common.bean.PageResultVo;
import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.pms.entity.*;
import com.atguigu.gmall.pms.vo.ItemGroupVO;
import com.atguigu.gmall.pms.vo.ItemSaleAttrVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Map;

public interface GmallPmsApi {
    @ApiOperation("根据分类id、spuId、skuId查询规格参数")
    @GetMapping("pms/attrgroup/withattrsGroup/{cid}/{spuId}/{skuId}")
    public ResponseVo< List<ItemGroupVO> > withattrsGroup(@PathVariable("cid")Long cid,
                                                          @PathVariable("spuId")Long spuId,
                                                          @PathVariable("skuId")Long skuId);
    @ApiOperation("根据spuid查询它下面的所有sku销售属性值组成的特定字符串 和skuid映射的 json")
    @GetMapping("pms/skuattrvalue/spu/skuJsons/{spuId}")
    public ResponseVo<String> querySkuJsonsBySpuId(@PathVariable("spuId")Long spuId);
    @ApiOperation("根据spuId查询该系列所有sku的销售属性和属性值列表")
    @GetMapping("pms/skuattrvalue/spu/{spuId}")
    public ResponseVo<List<ItemSaleAttrVO>> querySkuattrvaluesBySpuId(@PathVariable("spuId")Long spuId);
    @GetMapping("pms/spudesc/{spuId}")
    @ApiOperation("spu图片详情查询")
    public ResponseVo<SpuDescEntity> querySpuDescById(@PathVariable("spuId") Long spuId);
    @ApiOperation("根据3级分类id查询123级分类对象")
    @GetMapping("pms/category/level123cates/{c3id}")
    public ResponseVo<List<CategoryEntity>> queryLevel123cates(@PathVariable("c3id")Long c3id);
    @ApiOperation("根据skuid查询销售属性：商品详情页使用")
    @GetMapping("pms/skuattrvalue/saleAttrValues/{skuId}")
    public ResponseVo<Map<Long,String>> saleAttrValues(@PathVariable("skuId")
                                                               Long skuId);
    @GetMapping("pms/skuimages/sku/{skuId}")
    @ApiOperation("根据skuid查询图片列表")
    public ResponseVo<List<SkuImagesEntity>> querySkuImagesBySkuId(@PathVariable("skuId")
                                                                           Long skuId);
    @GetMapping("pms/sku/{id}")
    @ApiOperation("根据skuId详情查询")
    public ResponseVo<SkuEntity> querySkuById(@PathVariable("id") Long id);
    @ApiOperation("查询一级分类判断他是否有下一级分类")
    @GetMapping("pms/category/hasSubs")
    public ResponseVo<List<CategoryEntity>> hasSubs();
    @ApiOperation("根据一级分类id查询二三级商品分类")
    @GetMapping("pms/category/subs/{parentId}")
    public ResponseVo<List<CategoryEntity>> subs(@PathVariable("parentId")Long parentId);
    @ApiOperation("根据父id查询下一级商品分类")
    @GetMapping("pms/category/parent/{parentId}")
    public ResponseVo<List<CategoryEntity>> parent(@PathVariable("parentId")Long parentId);
    @GetMapping("pms/spu/{id}")
    @ApiOperation("根据spuId查询spu详情")
    public ResponseVo<SpuEntity> querySpuById(@PathVariable("id") Long id);
    @GetMapping("pms/spu/publish/{status}")
    @ApiOperation("分页查询已发布的Spu列表") //pojo入参
    public ResponseVo<List<SpuEntity>> queryPublishSpuByPage(@SpringQueryMap PageParamVo paramVo,
                                          @PathVariable("status")Integer status);

    @GetMapping("pms/spuattrvalue/searchAttrValues/{spuId}")
    @ApiOperation("根据spuId查询检索属性")
    public ResponseVo<List<SpuAttrValueEntity>> listSearchAttrValueBySpuId(
                                                @PathVariable("spuId")Long spuId);

    @ApiOperation("根据spuid查询sku集合")
    @GetMapping("pms/sku/spu/{spuId}")
    public ResponseVo<List<SkuEntity>> listBySpuId(@PathVariable("spuId")Long spuId);

    @GetMapping("pms/brand/{id}")
    @ApiOperation("品牌详情查询")
    public ResponseVo<BrandEntity> queryBrandById(@PathVariable("id") Long id);

    @GetMapping("pms/category/{id}")
    @ApiOperation("详情查询")
    public ResponseVo<CategoryEntity> queryCategoryById(@PathVariable("id") Long id);

    @ApiOperation("根据skuid查询检索属性")
    @GetMapping("pms/skuattrvalue/searchAttrValues/{skuId}")
    public ResponseVo<List<SkuAttrValueEntity>> searchAttrValues(@PathVariable("skuId")
                                                                         Long skuId);
}
